package org.gd.hellojaxb.example.map;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.HashMap;
import java.util.Map;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "map")
public class MapRoot {

    @XmlElement(name = "title")
    private String title;

    @XmlJavaTypeAdapter(MapAdaptersFactory.StringStringMapAdapter.class)
    @XmlElement(name = "map")
    private Map<String, String> mapProperty;

    public MapRoot() {
        mapProperty = new HashMap<String, String>();
        mapProperty.put("1", "1");
        mapProperty.put("2", "2");
        mapProperty.put("3", "3");
    }

    public Map<String, String> getMapProperty() {
        return mapProperty;
    }

    public void setMapProperty(Map<String, String> map) {
        this.mapProperty = map;
    }

}
